package com.kangdi.server.util;

import com.kangdi.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * 管理员工具类
 */
public class AdminUtil {
    /**
     * 获得当前管理员
     * @return
     */
    public static Admin getAdmin(){
        return (Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
